Optimal. Leaf size=58 \[ \frac {x}{a}+\frac {\tanh ^{-1}(\cos (c+d x))}{2 a d}+\frac {\cot (c+d x)}{a d}-\frac {\cot (c+d x) \csc (c+d x)}{2 a d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 58, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.185, Rules used = {2918, 2691,
3855, 3554, 8} \begin {gather*} \frac {\cot (c+d x)}{a d}+\frac {\tanh ^{-1}(\cos (c+d x))}{2 a d}-\frac {\cot (c+d x) \csc (c+d x)}{2 a d}+\frac {x}{a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2691
Rule 2918
Rule 3554
Rule 3855
Rubi steps
\begin {align*} \int \frac {\cos (c+d x) \cot ^3(c+d x)}{a+a \sin (c+d x)} \, dx &=-\frac {\int \cot ^2(c+d x) \, dx}{a}+\frac {\int \cot ^2(c+d x) \csc (c+d x) \, dx}{a}\\ &=\frac {\cot (c+d x)}{a d}-\frac {\cot (c+d x) \csc (c+d x)}{2 a d}-\frac {\int \csc (c+d x) \, dx}{2 a}+\frac {\int 1 \, dx}{a}\\ &=\frac {x}{a}+\frac {\tanh ^{-1}(\cos (c+d x))}{2 a d}+\frac {\cot (c+d x)}{a d}-\frac {\cot (c+d x) \csc (c+d x)}{2 a d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.35, size = 102, normalized size = 1.76 \begin {gather*} \frac {\left (\csc \left (\frac {1}{2} (c+d x)\right )+\sec \left (\frac {1}{2} (c+d x)\right )\right )^2 \left (\left (2 c+2 d x+\log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )\right ) \sin ^2(c+d x)+\cos (c+d x) (-1+2 \sin (c+d x))\right )}{8 a d (1+\sin (c+d x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.21, size = 84, normalized size = 1.45
method | result | size |
derivativedivides | \(\frac {\frac {\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}-2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {1}{2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}+\frac {2}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}-2 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+8 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d a}\) | \(84\) |
default | \(\frac {\frac {\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}-2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {1}{2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}+\frac {2}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}-2 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+8 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d a}\) | \(84\) |
risch | \(\frac {x}{a}+\frac {{\mathrm e}^{3 i \left (d x +c \right )}+{\mathrm e}^{i \left (d x +c \right )}+2 i {\mathrm e}^{2 i \left (d x +c \right )}-2 i}{a d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2}}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{2 a d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{2 a d}\) | \(100\) |
norman | \(\frac {\frac {x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {x \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {x \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {1}{8 a d}+\frac {3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{8 a d}-\frac {3 \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 a d}+\frac {\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )}{8 a d}+\frac {\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a d}+\frac {\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )}{4 a d}+\frac {3 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 a d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}-\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a d}\) | \(245\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 138 vs.
\(2 (54) = 108\).
time = 0.49, size = 138, normalized size = 2.38 \begin {gather*} -\frac {\frac {\frac {4 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {\sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}}{a} - \frac {16 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} + \frac {4 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} - \frac {{\left (\frac {4 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )} {\left (\cos \left (d x + c\right ) + 1\right )}^{2}}{a \sin \left (d x + c\right )^{2}}}{8 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.35, size = 104, normalized size = 1.79 \begin {gather*} \frac {4 \, d x \cos \left (d x + c\right )^{2} - 4 \, d x + {\left (\cos \left (d x + c\right )^{2} - 1\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - {\left (\cos \left (d x + c\right )^{2} - 1\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - 4 \, \cos \left (d x + c\right ) \sin \left (d x + c\right ) + 2 \, \cos \left (d x + c\right )}{4 \, {\left (a d \cos \left (d x + c\right )^{2} - a d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\cos ^{4}{\left (c + d x \right )} \csc ^{3}{\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.56, size = 103, normalized size = 1.78 \begin {gather*} \frac {\frac {8 \, {\left (d x + c\right )}}{a} - \frac {4 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{a} + \frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 4 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{2}} + \frac {6 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 4 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1}{a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2}}}{8 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.75, size = 159, normalized size = 2.74 \begin {gather*} \frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,a\,d}-\frac {2\,\mathrm {atan}\left (\frac {2\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )-\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )+2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{a\,d}-\frac {{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,a\,d}-\frac {\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{2\,a\,d}+\frac {\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,a\,d}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,a\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________